package week5;

public class PrimeNumbers {
    public static boolean isPrime(int n) {
        if (n <= 1) {
            return false;
        }
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }
    public static void main(String[]args){
        for (int num=1;num<=1000;num++){
            if(isPrime(num)){
                System.out.print(num+" ");
            }
        }
    }
}
